package com.dbs.donatebooksystem.Service.impl;

import com.dbs.donatebooksystem.Service.RequirementService;
import com.dbs.donatebooksystem.mapper.RequirementMapper;
import com.dbs.donatebooksystem.pojo.Requirement;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Slf4j
@Service
public class RequirementServiceImpl implements RequirementService {
    @Autowired
    private RequirementMapper requirementMapper;
    @Override
    public List<Requirement> SelectRequirements() {
       List<Requirement> list= requirementMapper.SelectRequirements();
        return list;
    }

    @Override
    public boolean InsertRequire(Requirement requirement) {
        if(requirement.getMessage()==""||requirement.getName()==""||requirement.getSpace()==""||requirement.getUserId()==null){
            return false;
        }
        requirementMapper.insert(requirement);
        return true;
    }
}
